cmake_minimum_required(VERSION 3.2)
project(Example3)

set(myVar foo)

message("Parent (before): myVar = ${myVar}")
message("Parent (before): childVar = ${childVar}")

add_subdirectory(subdir)

message("Parent (after): myVar = ${myVar}")
message("Parent (after): childVar = ${childVar}")